package com.taxshare.seller.service;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.taxshare.mybatis.utils.DozerBeanUtil;
import com.taxshare.response.beans.Response;
import com.taxshare.seller.constant.CodeConstant;
import com.taxshare.seller.entity.*;
import com.taxshare.seller.mapper.CancelDocDetailMapper;
import com.taxshare.seller.mapper.DocumentInfoDetailMapper;
import com.taxshare.seller.mapper.DocumentInfoMapper;
import com.taxshare.seller.mapper.InvoicedMapper;
import com.taxshare.seller.view.dto.RedInvoiceInfoFirstDTO;
import com.taxshare.seller.view.vo.RedTicketOperateReqVO;
import com.taxshare.seller.view.vo.SellerInvoiceRVO;
import com.taxshare.tools.util.DateUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.ArrayList;
import java.util.List;

/**
 * @author YANG
 * @date 2021/7/11
 */
@Service
@Transactional(propagation = Propagation.REQUIRED, isolation = Isolation.READ_COMMITTED)
@Slf4j
public class AsyncDocumentService extends ServiceImpl<DocumentInfoMapper, DocumentInfoEntity> {


    @Autowired
    InvoiceDetailService invoiceDetailService;

    @Autowired
    InvoicedService invoicedService;

    @Autowired
    RedTicketService redTicketService;



    /**
     * 异步红冲发票
     */
    public void makeRedIncoice(String serialNo) {
        invoicedService.makeRedCommonInvoice(serialNo);
    }
}
